#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {
    int a, b, c, d, count = 0;
    float mod;
    while (scanf("%d", &a) != EOF)
    {
        for (int i = 1; i <= a; i++)
        {
            scanf("%d %d %d", &b, &c, &d);
            mod = (b + c + d) / 3.0;
            if (mod < 60)
                count++;
        }
    }
    printf("%d", count);
    return 0;
}